package lab01;

public class Test05 {
    public static void main(String[] args) {
        foradd();
        whileadd();
        dowhileadd();
    }

    public static void foradd() {
        int sum=0;
        for(int n=1;n<=10;n++) {
            sum=sum+n;
        }
        System.out.println(sum);
    }

    public static void whileadd() {
        int n=1;
        int sum=0;
        while(n<=10) {
            sum=sum+n;
            n++;
        }
        System.out.println(sum);
    }

    public static void dowhileadd() {
        int n=1;
        int sum=0;
        do {
            sum=sum+n;
            n++;
        }while (n<=10);
        System.out.println(sum);
    }

}
